import Vue from 'vue'
import Vuex from 'vuex'
import modules from "./modules/index.js";
import getters from "./getters";
Vue.use(Vuex);
const debug = process.env.NODE_ENV !== "production";
export default new Vuex.Store({
	modules,
	getters,
	strict: false,
	state: {
		videoList:[],
		userInfo: null,
		token: '',
		tempUser: {},
		kf: '' ,// 客服电话
		videoPlay:true,
		refreshVideo:false
	},
	mutations: {
		setVideoList(state,videoList){
			Vue.set(state,'videoList',videoList)
			// state.videoList = videoList
		},
		saveUserInfo(state, user) {
			state.userInfo = user;
		},
		saveToken(state, token) {
			state.token = token;
			uni.setStorageSync("sstoken", token)
		},
		saveTempUser(state, user) {
			state.tempUser = user
		},
		saveKF(state, mobile) {
			state.kf = mobile
		}
	}
})